<?
require_once 'config.php';
$ser_id = getValue('iPro','int','GET',0);
$templateServices = new TemplateServices();
$ser_info = $templateServices->ser_detail($ser_id);
if(!$ser_info) redirect('/');
$ser_arr_cat = $templateServices->ser_cat_all($ser_info['ser_cat_id']);
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="vi" lang="vi" xmlns:og="http://ogp.me/ns#" xmlns:fb="">
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
   <link type="image/x-icon" href="/favicon.ico" rel="icon" />
   
   <title><?=(showSeoTitle('services',$ser_id) != '') ? showSeoTitle('services',$ser_id) : $ser_info['ser_title']?></title>
   <meta name="description" content="<?=(showSeoMeta('services',$ser_id) != '') ? showSeoMeta('services',$ser_id) : $ser_info['ser_summary']?>"/>
   <meta name="keywords" content=""/>
   <meta name="AUTHOR" content="Sudo.vn" />
   <meta name="COPYRIGHT" content="Sudo.vn" />
   <meta name="ROBOTS" content="INDEX, FOLLOW" />
   <meta name="RATING" content="GENERAL" />
   <meta property="fb:admins" content="100004609203263" />
   <meta property="fb:app_id" content="1494369264117261"/>
   <link rel="canonical" href='<?=DOMAIN.generate_service_detail_url($ser_info)?>'/>
   <!-- css -->   
   <link rel="stylesheet" type="text/css" href="<?=TEMPLATE_PATH?>css/jquery-ui.css" media='all'/>
   <link rel="stylesheet" type="text/css" href="<?=TEMPLATE_PATH?>css/home.css" media='all'/>
   <link rel="stylesheet" type="text/css" href="<?=TEMPLATE_PATH?>css/service.css" media='all'/>
   
   <!-- js -->
   <script type="text/javascript" src="<?=TEMPLATE_PATH?>js/jquery-1.9.0.min.js"></script>
   <script type="text/javascript" src="<?=TEMPLATE_PATH?>js/common.js"></script>
</head>
<body> 
   <? include("../social_plugins/facebook.php");?>
   <div class="global_container">
      <? include('view/common/vic_header.php')?>
      <div class="content_wrap">
         <div class="cumbs_wrap">
            <div class="crumbs width">
               <ul>              
            		<li><a href="/">Trang chủ </a> &nbsp;>&nbsp; </li>
                   <?
                     foreach($ser_arr_cat as $key=>$row){
                  ?>
            		<li><a href="<?=generate_service_cat_url($row)?>"><?=$row['cat_name']?> </a> <?=(($key+1)< count($ser_arr_cat))? '&nbsp;>&nbsp;' :''?> </li>
                  <? } ?>
            	</ul>
               <div class="clear"></div>
            </div>
         </div>
         <div class="content_inner width">
            <div class="content_left">
               <?include('view/common/vic_content_left.php')?>               
            </div>
            <div class="content_right">
               <div class="services_wrap">              
                  <h1 class="post_title" style="font-size: 16px;"><?=$ser_info['ser_title']?> </h1>
                  <p class="post_date"><?=getDateTime(1,1,1,1,'',$ser_info['ser_date'])?></p>
                  <div class="post_description">
                     <b><?=$ser_info['ser_summary']?></b>
                  </div>
                  <div class="post_detail">
                     <?=$ser_info['ser_detail']?>
                  </div>
               </div>
               <div class="post_connection">
                  <p class="categories_title">
                     BÀI LIÊN QUAN
                  </p>
                  <?
                     $ser_connection = $templateServices->ser_connection($ser_id,$ser_info['ser_cat_id']);
                     foreach($ser_connection as $key=>$row){
                  ?>
                        
                        <p><a href="<?=generate_service_detail_url($row)?>"><?=$row['ser_title']?></a></p>
                        
                  <?
                     }
                  ?>
               </div>
               <div class="comments_main_item comments_main_fb" style="z-index: 1000;position: relative">
                 <div class="fb-comments" data-href="<?=DOMAIN.$_SERVER['REQUEST_URI']?>" data-colorscheme="light" data-numposts="5" data-width="723"></div>
               </div>
            </div>
         </div>
         <div class="clear"></div>
      </div>
      <div class="clear"></div>
      <?include('view/common/vic_footer.php')?>
   </div>
</body>
</html>
<script>
$(document).ready(function(){
   $(window).scroll(function(){
      var y = $(window).scrollTop();
      
      var elementOffset = $('.post_new').offset().top;
      var danhmuc_height = $('.categories').height();
      var bailienquan_height = $('.post_connection').height();
      if(y <= 213 + danhmuc_height + bailienquan_height + 45){
         $('.post_new').removeClass('post_new_fixed')         
      }
      if(y > elementOffset){
         $('.post_new').addClass('post_new_fixed');         
      } ;
      if(y>500) $('.post_new').css({'top':'32px'});
      else{ $('.post_new').css({'top':'-20px'})}
   });
})
</script>